Taking screenshot without shadow in macOS

The standard keyboard shortcut for taking an app window screenshot on Mac is Shift + ⌘ + 5. To remove drop shadow on screenshots, start using the shortcut as usual but before taking a picture, press and hold the Option key. That's it, now your screenshot should be saved with no shadows at all.

https://setapp.com/how-to/remove-mac-screenshot-shadow

Another option to turn off the shadow by default:

In Terminal app, use the following command.

defaults write com.apple.screencapture disable-shadow true

And then to restart the Finder by using the following command.

killall SystemUIServer

You can revert the setting by using the following command in Terminal.

defaults write com.apple.screencapture disable-shadow false
killall SystemUIServer